import 'package:flutter/material.dart';

class FlatsButton extends StatelessWidget {
  Function? onPressed;
  OutlinedBorder? shape;
  Color? color;
  Color? highlightColor;
  Widget child;
  EdgeInsets? padding;

  FlatsButton({
    this.onPressed,
    this.shape,
    this.color,
    required this.child,
    this.highlightColor,
    this.padding
  });

  @override
  Widget build(BuildContext context) {
    return TextButton(
      onPressed: (){
        if(onPressed!=null){
          onPressed!();
        }
      },
      child: child,
      style: ButtonStyle(
          shape: WidgetStateProperty.all(shape),
          backgroundColor: WidgetStateProperty.all(color),
          overlayColor: WidgetStateProperty.all(highlightColor),
      padding: WidgetStateProperty.all(padding)),
    );
  }
}
